<template>
  <view class="content">
    <u-cell-group>
      <u-cell
        :value="item.deal_text"
        v-for="item in receiveList"
        :key="item.id"
      >
        <view slot="title" class="u-slot-title">
          <view>
            {{ item.business.nickname }}
          </view>
        </view>
        <view slot="label" class="u-slot-label">
          <view style="color: #909193"> 状态：{{ item.status_text }} </view>
          <view style="color: #909193">
            领取时间：{{
              $u.timeFormat(item.applytime, "yyyy年mm月dd日 hh:MM")
            }}
          </view>
        </view>
      </u-cell>
    </u-cell-group>

    <u-modal
      :show="show"
      :content="content"
      :showCancelButton="true"
      @confirm="confirm"
      @cancel="show = false"
    ></u-modal>
    <u-toast ref="uToast"></u-toast>
  </view>
</template>

<script>
export default {
  data() {
    return {
      receiveList: [],
      LoginAdmin: {},
      show: false,
      id: 0,
    };
  },
  onShow() {
    this.LoginAdmin = uni.getStorageSync("LoginAdmin")
      ? uni.getStorageSync("LoginAdmin")
      : [];

    this.getReceiveData();
  },
  methods: {
    async getReceiveData() {
      let data = {
        applyid: this.LoginAdmin.id,
      };

      let result = await this.$u.api.manage.receiveIndex(data);

      if (result.code === 1) {
        this.receiveList = result.data;
      }
    },
  },
};
</script>